<!doctype html>
<html>
 <head>
  <title>audio.src - reflection test</title>
  <script src="../../w3cwrapper.js"></script>
 </head>
 <body>
  <p><a href="http://dev.w3.org/html5/spec/Overview.html#dom-media-src">spec reference</a></p>
  <audio id="audio">
  </audio>
  <div id="log"></div>
  <script>
var t = async_test("removing src attribute should not trigger loadstart event", {timeout:10000});
var removed_attr = false;
var test_done = false;
var v = document.getElementById("audio");
v.addEventListener("loadstart", function() {
  if (!removed_attr) { 
    window.setTimeout(function() {
     removed_attr = true;
     v.removeAttribute("src");
    }, 0);
    window.setTimeout(function() {
     if (test_done) { return; }
     test_done = true;
     t.step(function(){ assert_true(true); });
     t.done();
    }, 1000);
   return;
  }
  if (test_done) { return; }
  test_done = true;
  t.step(function(){ assert_false(true); });
  t.done();
});
v.src = getAudioURI("http://media.w3.org/2010/05/sound/sound_5") + "?" + new Date() + Math.random();
  </script>
 </body>
</html>
